#pragma once

#include "geometry.h"

namespace kp {

    Point2f ConcentricSampleDisk(const Point2f& u);

    inline Vec3f CosineSampleHemisphere(const Point2f& u) {
        Point2f d = ConcentricSampleDisk(u);
        Float z = std::sqrt(std::max((Float)0, 1 - d.x * d.x - d.y * d.y));
        return Vec3f(d.x, d.y, z);
    }

}
